﻿#region

using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;

#endregion

namespace BTL.Technology.Data
{
    public interface IDataHelper
    {
        TObject FillObject<TObject>(string connectionString, string procedureName, params object[] parameterValues);

        TObject FillObject<TObject>(string connectionString, string procedureName, bool closeReader,
                                    params object[] parameterValues);

        List<TItem> FillCollection<TItem>(string connectionString, string procedureName, params object[] parameterValues);

        List<TItem> FillCollection<TItem>(string connectionString, string procedureName, bool closeReader,
                                          params object[] parameterValues);


        DataSet ExecuteDataset(string connectionString, string procedureName, params object[] parameterValues);
        SqlDataReader ExecuteReader(string connectionString, string procedureName, params object[] parameterValues);
        TReturn ExecuteScalar<TReturn>(string connectionString, string spName, params object[] parameterValues);
        void ExecuteNonQuery(string connectionString, string spName, params object[] parameterValues);

        string SerializeObject(object objObject);
        string SerializeObject(object objObject, string root);
        string SerializeCollection(object objCollection);
        string SerializeCollection(object objCollection, string root);
        string SerializeCollection(object objCollection, string root, Encoding encoding);
    }
}